<p-dialog  [(visible)]="display" modal="modal"  [responsive]="true" [width]="width" [minWidth]="200" (onHide)="closeInspectionEditMask(false)" >
  <p-header>
    {{title}}
  </p-header>
  <div class="ui-g">
    <div class="ui-g-12">
        <button pButton type="button"  label="添加" (click)="showAddTime()" *ngIf="shiftState ==='update'"></button>
        <button pButton type="button"  label="删除"  (click)="deleteInspectionShift()" [disabled]="!selectInsepections||selectInsepections.length===0" *ngIf="shiftState ==='update'"></button>
    </div>
    <div class="ui-g-12 my-datatable">
      <div class="file-box">
        <p-dataTable [value]="editShifts"
                     [totalRecords]="totalRecords"  [(selection)]="selectInsepections" *ngIf="shiftState ==='update'">
          <p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
          <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"></p-column>
          <p-column header="操作">
            <ng-template let-car="rowData" pTemplate="body" let-i="rowIndex">
              <button pButton type="button" label="修改" (click)="updateAddTime(editShifts[i])"></button>
              <!--<button pButton type="button" label="删除"  ></button>-->
            </ng-template>
          </p-column>
          <ng-template pTemplate="emptymessage">
            当前没有数据
          </ng-template>
        </p-dataTable>
        <p-dataTable [value]="editShifts"
                     [totalRecords]="totalRecords"   *ngIf="shiftState==='view'">
          <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"></p-column>
          <ng-template pTemplate="emptymessage">
            当前没有数据
          </ng-template>
        </p-dataTable>
        <!--<div>{{selectInsepections|json}}</div>-->
        <p-paginator rows="10" [totalRecords]="totalRecords" [rowsPerPageOptions]="[10,20,30]" (onPageChange)="paginate($event)"></p-paginator>
      </div>
    </div>
  </div>
  <p-footer>
    <button type="button" pButton icon="fa-close"  label="关闭" (click)="closeInspectionEditMask(false)"></button>
  </p-footer>
</p-dialog>
<app-add-cycle-time
  (closeAddCycleTimeMask)="closeAddCycleMask($event)"
  [state]="state"
  [currentCycleTime]="currentCycleTime"
  (updateDev)="updateCycleTime($event)"
  (addDev)="addTimeCycleTime($event)"
  *ngIf="addTime">
</app-add-cycle-time>
